using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Zhaoxi.Zhihu.Core.AppUserAggregate.Entites;

namespace Zhaoxi.Zhihu.Infrastructure.Configuration;

public class AppUserConfiguration:IEntityTypeConfiguration<AppUser>
{
    public void Configure(EntityTypeBuilder<AppUser> builder)
    {
        builder.Property(p => p.Id)
            .ValueGeneratedNever();

        builder.Property(p => p.Nickname)
            .HasMaxLength(DataSchemaConstans.DefaultAppUserNickNameLength);

        builder.Property(p => p.Bio)
            .HasMaxLength(DataSchemaConstans.DefaultAppUserBioLength);
    }
}